//
//  BEDrawingboardView.swift
//  BEGlobalOiler
//
//  Created by KKING on 16/9/29.
//  Copyright © 2016年 Bullseye Energy pte ltd. All rights reserved.
//

import UIKit

class BEDrawingboardView: UIView {
    
    let lookPackageVc = BELookPackageController()
    
    //现有的talentId
    var ordertalentId: String = ""
    
    var dismissboardBlock: (() -> ())?
    var changeimgHidBlock: (() -> ())?
    
    
    class func drawingboardView()->UIView {
        return Bundle.main.loadNibNamed("BEDrawingboardView", owner: nil, options: nil)!.last as! BEDrawingboardView
    }
    
    @IBAction func cancleBtnDidClick(sender: UIButton) {
        //        lookPackageVc.performSelector(#selector(lookPackageVc.cancleBtnDidClick))
        dismissboardBlock!()
    }
    
    @IBAction func doneBtnDidClick(sender: UIButton) {
        //        lookPackageVc.performSelector(#selector(lookPackageVc.doneBtnDidClick))
        JFProgressHUD.showloading()
        BENetworkTools.shareNetworkTool.confirmPackage(ordertalentId: ordertalentId,resourceId: 000) { (success, result, error) in
            guard let resultjson = result else {
                JFProgressHUD.showWithStatus(status: "您的网络不给力")
                return
            }
            if resultjson["success"] == true {
                JFProgressHUD.showSuccessWithStatus(status: "confirm package success!")
            } else {
                JFProgressHUD.showInfoWithStatus(status: resultjson["message"].stringValue)
            }
        }
        self.changeimgHidBlock!()
        dismissboardBlock!()
    }
    
    @IBAction func clearBtnDidClick(sender: UIButton) {
        
    }
    
    
}
